set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)

set(link_libs wlosal protocol)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/wlosal)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/protocol)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/wlsdk)

add_custom_target(combined
        COMMAND ${CMAKE_AR} -x $<TARGET_FILE:wlsdk>
        COMMAND ${CMAKE_AR} -x $<TARGET_FILE:wlosal>
        COMMAND ${CMAKE_AR} -x $<TARGET_FILE:protocol>
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/obj
        COMMAND ${CMAKE_AR} -qcs ${weila_sdk_lib} ${CMAKE_BINARY_DIR}/obj/*.o*
        DEPENDS wlosal protocol wlsdk)



